extern "C" { 
    #include "apue.h" 
}   

#include <stdio.h>
#include <stdlib.h>

//int atexit(void (*function)(void));

typedef void (*myexit)(void);

void exit1()
{
    printf("exit 1\n");
}
void exit2()
{
    printf("exit 2\n");
}
void exit3()
{
    static int a=0;
    printf("exit 3,static num=%d\n",a++);
}

int main(int argc, char const *argv[])
{
    atexit(exit1);
    atexit(exit2);
    atexit(exit3);
    atexit(exit3);
    printf("main in\n");
    return 1;
}
